package com.neusoft;

import javax.annotation.processing.Filer;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Properties;
import java.util.Set;

public class ReaderDemoProps {

    public static void main(String[] args) throws Exception {
        //创建字符流对象
//        FileReader fr = new FileReader("d:\\neusoft.txt");

//        int len = 0;
//        char[] chars = new  char[1024];
//        while((len=fr.read(chars))!=-1){
//            System.out.println(new String(chars));
//        }
        Properties props = new Properties();
        props.load(new FileReader("d:\\neusoft.txt"));
        Set<String> strings = props.stringPropertyNames();

        for (String string : strings) {
            //System.out.println(string+","+props.get(string));
            System.out.println(string+","+props.getProperty(string));
        }

//        fr.close();


    }
}
